package com.smooth.dao.gen;

import com.smooth.dao.gen.bean.BaseSchSubject;
import com.smooth.dao.gen.bean.BaseSchSubjectExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface BaseSchSubjectMapper {
    /** base_sch_subject */
    @SelectProvider(type=BaseSchSubjectSqlProvider.class, method="countByExample")
    long countByExample(BaseSchSubjectExample example);

    /** base_sch_subject */
    @DeleteProvider(type=BaseSchSubjectSqlProvider.class, method="deleteByExample")
    int deleteByExample(BaseSchSubjectExample example);

    /** base_sch_subject */
    @Delete({
        "delete from base_sch_subject",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String id);

    /** base_sch_subject */
    @Insert({
        "insert into base_sch_subject (id, sub_name, ",
        "faculty, sch_id, ",
        "sch_name, create_date, ",
        "update_date, del_flag)",
        "values (#{id,jdbcType=VARCHAR}, #{subName,jdbcType=VARCHAR}, ",
        "#{faculty,jdbcType=VARCHAR}, #{schId,jdbcType=VARCHAR}, ",
        "#{schName,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}, ",
        "#{updateDate,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=SMALLINT})"
    })
    int insert(BaseSchSubject record);

    /** base_sch_subject */
    @InsertProvider(type=BaseSchSubjectSqlProvider.class, method="insertSelective")
    int insertSelective(BaseSchSubject record);

    /** base_sch_subject */
    @SelectProvider(type=BaseSchSubjectSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="sub_name", property="subName", jdbcType=JdbcType.VARCHAR),
        @Result(column="faculty", property="faculty", jdbcType=JdbcType.VARCHAR),
        @Result(column="sch_id", property="schId", jdbcType=JdbcType.VARCHAR),
        @Result(column="sch_name", property="schName", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_date", property="updateDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="del_flag", property="delFlag", jdbcType=JdbcType.SMALLINT)
    })
    List<BaseSchSubject> selectByExample(BaseSchSubjectExample example);

    /** base_sch_subject */
    @Select({
        "select",
        "id, sub_name, faculty, sch_id, sch_name, create_date, update_date, del_flag",
        "from base_sch_subject",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="sub_name", property="subName", jdbcType=JdbcType.VARCHAR),
        @Result(column="faculty", property="faculty", jdbcType=JdbcType.VARCHAR),
        @Result(column="sch_id", property="schId", jdbcType=JdbcType.VARCHAR),
        @Result(column="sch_name", property="schName", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_date", property="updateDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="del_flag", property="delFlag", jdbcType=JdbcType.SMALLINT)
    })
    BaseSchSubject selectByPrimaryKey(String id);

    /** base_sch_subject */
    @UpdateProvider(type=BaseSchSubjectSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") BaseSchSubject record, @Param("example") BaseSchSubjectExample example);

    /** base_sch_subject */
    @UpdateProvider(type=BaseSchSubjectSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") BaseSchSubject record, @Param("example") BaseSchSubjectExample example);

    /** base_sch_subject */
    @UpdateProvider(type=BaseSchSubjectSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(BaseSchSubject record);

    /** base_sch_subject */
    @Update({
        "update base_sch_subject",
        "set sub_name = #{subName,jdbcType=VARCHAR},",
          "faculty = #{faculty,jdbcType=VARCHAR},",
          "sch_id = #{schId,jdbcType=VARCHAR},",
          "sch_name = #{schName,jdbcType=VARCHAR},",
          "create_date = #{createDate,jdbcType=TIMESTAMP},",
          "update_date = #{updateDate,jdbcType=TIMESTAMP},",
          "del_flag = #{delFlag,jdbcType=SMALLINT}",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(BaseSchSubject record);
}